/*
 * @Title: 首页
 * @Created by: ycq 
 */
<template>
	<view style="overflow: hidden;">
		<IndexHead :config='pageConfig'></IndexHead>
		<view class="main-goods"  style="overflow: hidden;">
			<image src="/static/banner.png" mode=""></image>
			<view class="item-right">
				<text class="main-title">宫廷古风中国风口红 长相思持久保湿防水</text>
				<text class="main-shop">平台自营</text>
				<view class="pri">
					<text class="mny">￥<text class="main-price">256</text></text>
					<text class="pay-num">2563人付款</text>
				</view>
			</view>
		</view>
		<view class="c-title">
			<image src="/static/shop/bl.png" mode=""></image>
			<text>同款商品推荐</text>
			<image src="/static/shop/bl.png" mode=""></image>
		</view>
		<view class="goods-list">
			<view class="goods-item" v-for='(item,index) in goodsData' :key='index' >
				<view class="other-btn" @click="openMask(index)">
					<view class="other-btn-dot"></view><view class="other-btn-dot"></view><view class="other-btn-dot"></view>
				</view>
				<view class="item-btns" v-if="openIndex == index">
					<view class="item-btn">
						<image src="/static/nolike.png"></image>
						<text>不感兴趣</text>
					</view>
					<view class="item-btn">
						<image src="/static/pingbi.png"></image>
						<text>屏蔽:扇子</text>
					</view>
					<view class="item-btn">
						<image src="/static/bushi.png"></image>
						<text>图片引起不适</text>
					</view>
					<view class="item-btn">
						<text>找同款</text>
					</view>
				</view>
				<view><image class="item-img" @click="toDetail()" :src="item.img"></image>
				<text class="title" @click="toDetail()">
					{{item.title}}
				</text>
				<text class="prize" @click="toDetail()"><text class="p-dot">￥</text>{{item.prize}}<text class="p-dot">{{item.prizeD}}</text></text>
				<text class="buyNum" @click="toDetail()">{{item.buyNum}}人付款</text></view>
				
			</view>
			
		</view>
		<top-view></top-view>
	</view>
</template>

<script>
	export default{
		data(){
			return{
				openIndex:null,
				pageConfig:{
					common:{
						hasSearch:false, //显示整版搜索框
						hasTitle:true, //显示页面title
						hasMenu:false,
					},
					left:{
						img:'/static/pos-home.png' , //左侧图标
						text:'沈阳市', //左侧文字
						showPos:false,
					},
					mid:{
						title:'查同款' ,//页面title
						hasSearchMid:false //显示中间搜索框
					},
				},
				goodsData:[
					{
						title:'宫廷古风中国风口红 长相思持久保湿防水',
						img:'/static/banner.png',
						prize:'69.',
						prizeD:'5',
						buyNum:123123
					},
					{
						title:'国粹京剧脸谱戏曲Q版人物吊坠书签金属创意古风',
						img:'/static/banner.png',
						prize:'69.',
						prizeD:'5',
						buyNum:1223
					},
					{
						title:'中国特色礼物送老外北京特色工艺品京剧脸谱摆件商务外事出国礼品',
						img:'/static/banner.png',
						prize:'69.',
						prizeD:'5',
						buyNum:1564
					},
					{
						title:'砚台天然原石 复刻故宫博物院款式 松花砚',
						img:'/static/banner.png',
						prize:'69.',
						prizeD:'5',
						buyNum:2333
					}
				],
			}
		},
		methods: {
			toDetail(){
				uni.navigateTo({
					url:'shopDetail'
				})
			},
			openMask(index){
				if(this.openIndex != index){
					this.openIndex = index
				}else{
					this.openIndex = null
				}
			},
		},
	}
</script>

<style scoped>
	.main-goods{
		position: absolute;
		width: 688upx;
		height: 206upx;
		background: #ffffff;
		margin-left: 30upx;
		margin-right: auto;
		top: 155upx;
		border-radius: 20upx;
		margin-bottom: 100upx;
		box-shadow: 2px 4px 20px 1px #e2e2e2;
	}
	.main-goods image{
		width: 220upx;
		height: 206upx;
		border-radius: 20upx 0 0 20upx;
		float: left;
	}
	.item-right{
		float: right;
		width: 468upx;
		height: 206upx;
	}
	.main-title{
		margin-top: 24upx;
		width: 397upx;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 2;
		height: auto;
		overflow: hidden;
		margin-left: 38upx;
		font-size: 26upx;
	}
	.main-shop{
		width: 379upx;
		margin-left: 38upx;
		margin-top: 20upx;
		color: #999999;
		font-size: 24upx;
	}
	.pri{
		width: 379upx;
		margin-left: 38upx;
		height: 30upx;
		margin-top: 10upx;
		display: flex;
		flex-direction: row;
		justify-content: space-between;
	}
	.mny{
		color: #55A0FF;
		font-size: 24upx;
	}
	.main-price{
		font-size: 28upx;
	}
	.pay-num{
		color: #999999;
		line-height: 38upx;
		font-size: 24upx;
	}
	.c-title{
		width: 750upx;
		height: 60upx;
		
		display: flex;
		flex-direction: row;
		margin-top: 130upx;
		justify-content: center;
	}
	.c-title text{
		font-size: 28upx;
		margin-left: 40upx;
		margin-right: 40upx;
		color: #010101;
		font-weight: bold;
	}
	.c-title image{
		margin-top: 15upx;
		width: 81upx;
		height: 15upx;
	}
	
	
	
	.goods-list{
		width: 710upx;
		margin-left: 20upx;
		margin-right: 20upx;
		height: calc(100vh - 240px);
		overflow: scroll;
		
		/* margin-bottom: 60upx; */
		/* display: table; */
	}
	.list-title{
		width: 100%;
		margin-left: auto;
		margin-right: auto;
		height: 8vw;
		margin-top: 3vh;
	}
	.list-title span{
		font-size: 4.5vw;
		font-weight: bolder;
	}
	.shu{
		width: 0.7%;
		height: 3.06vw;
		background: #55A0FF;
		float: left;
		margin-top: 2.3vw;
		margin-right: 10px;
	}
	.goods-item{
		width: 338upx;
		height: 515upx;
		margin-top: 24upx;
		position: relative;
	}
	.goods-item:nth-child(even){
		float: left;
	}
	.goods-item:nth-child(odd){
		float: right;
	}
	.goods-item .item-img{
		width: 338upx;
		height: 336upx;
		border-radius: 15upx 15upx 0 0;
	}
	.goods-item .title{
		padding-left: 24upx;
		padding-right: 24upx;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 2;
		overflow: hidden;
		font-family: PingFang SC Regular;
		font-size: 26upx;
		font-weight: bold;
	}
	.prize{
		height: 38upx;
		color: #55A0FF;
		float: left;
		font-size: 30upx;
		margin-top: 50upx;
		margin-left: 24upx;
		text-align: left;
	}
	.p-dot{
		font-size: 26upx;
	}
	.buyNum{
		width: 200upx;
		float: right;
		text-align: right;
		font-size: 25upx;
		color: #999999;
		margin-right: 24upx;
		margin-top: 56upx;
	}
	.other-btn{
		width: 49upx;
		height: 29upx;
		background: rgba(0,0,0,0.5);
		z-index: 10;
		right: 9upx;
		top:9upx;
		border-radius: 15upx;
		display: flex;
		flex-direction: row;
		position: absolute;
		justify-content: center;
	}
	.other-btn-dot{
		width: 6upx;
		height: 6upx;
		margin-left: 2upx;
		margin-right: 2upx;
		margin-top: 11upx;
		background: #FFFFFF;
		border-radius: 50%;
	}
	.item-btns{
		position: absolute;
		width: 338upx;
		height: 455upx;
		padding-top: 60upx;
		border-radius: 15upx;
		z-index: 8;
		background: rgba(0,0,0,0.5);
	}
	.item-btns image{
		width: 36upx;
		height: 36upx;
		margin-top: 10upx;
		margin-right: 10upx;
	}
	.item-btn{
		width: 260upx;
		height: 60upx;
		background: #FFFFFF;
		border-radius: 50upx;
		margin-left: auto;
		margin-right: auto;
		margin-top: 30upx;
		display: flex;
		flex-direction: row;
		justify-content: center;
	}
	.item-btn text{
		font-size: 26upx;
		color: #333333;
		line-height: 60upx;
	}
</style>
